import React from 'react';
import classnames from 'classnames';
import './index.less';

const CurrencyModal: React.FC = (props: any) => {

  let currencyModalClose = (
    <img src={require('@/common/icon26.png')} alt="" className="currencyModalClose handControl" onClick={() => props.onClose && props.onClose()} />
  )
  let currencyModalOperation = (
    <div className="currencyModalOperation">
      <div className="currencyModalButton currencyModalCancel handControl" onClick={() => props.onClose && props.onClose()}>{ props.closeText ||  '取消' }</div>
      <div className="currencyModalButton currencyModalOk handControl" onClick={() => props.onOk && props.onOk()}>{ props.okText ||  '确定' }</div>
    </div>
  )

  return (
    <div className="CurrencyModal">
      <div className={classnames("currencyModalView", props.viewClass)}>
        { props.children }
        { props.close && currencyModalClose }
        { props.operation && currencyModalOperation }
      </div>
    </div>
  );
};

export default CurrencyModal;
